<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <head>
    <title>Test Projects</title>
  </head>

  <body>
    <div id="content" class="projects">
      <h1>Test Projects</h1>

      <py:choose test="projects.count() == 0">

      <py:when test="True">
      <div id="description">
        <p>No project found.</p>
      </div>
      </py:when>

      <py:otherwise>
      <table class="listing projects">
        <thead>
          <tr>
            <th><a href="${href.test(sort='id', asc=0)}">ID</a></th>
            <th><a href="${href.test(sort='name', asc=0)}">Name</a></th>
            <th><a href="${href.test(sort='created', asc=0)}">Created</a></th>
            <th colspan="2">Actions</th>
          </tr>
        </thead>
        <tbody>
          <py:for each="idx, project in enumerate(projects)">
            <tr class="${idx % 2 and 'odd' or 'even'}">
              <td>$project.node.id</td>
              <td class="title"><a href="${href.test('spec', project.node.id)}">$project.node.name</a></td>
              <td class="datetime">${format_datetime(project.node.created, '%Y/%m/%d %H:%M')}</td>
              <td class="action"><a py:if="'TEST_EDIT' in perm('test', project.node.id)"
                                    href="${href.test(project.node.id, 'customfields')}"
                                    title="Edit custom field">Edit Field</a></td>
              <td class="action"><a py:if="'TEST_DELETE' in perm('test', project.node.id)"
                                    href="${href.test(project.node.id, action='delete')}"
                                    title="Delete test project">Delete</a></td>
            </tr>
          </py:for>
        </tbody>
      </table>
      </py:otherwise>

      </py:choose>

      <div py:if="'TEST_CREATE' in perm" class="buttons">
        <form method="get" action="${href.test('newproject')}">
          <div>
            <input type="submit" value="Create new project" />
          </div>
        </form>
      </div>

      <div id="help"><strong>Note:</strong> 
        See <a href="${href.wiki(TracTestManagement)}">TracTestManagement</a> for help on using and creating test project.
      </div> 

    </div>
  </body>
</html>

